#include "list.h"
using namespace std;
 
void test_list_int()
{
	list<int> listOne;  		//用LISTINT创建一个list对象
	list<int>::iterator iter;  	//声明i为迭代器
 
	listOne.push_front(3);
	listOne.push_front(2);
	listOne.push_front(1);
 
	listOne.push_back(4);
	listOne.push_back(5);
	listOne.push_back(6);

	cout << " print list int content: " << endl;
	for (iter = listOne.begin(); iter != listOne.end(); ++iter)
		cout << *iter << " ";
	cout << endl;
	cout << endl;
	cout << endl;
}

void test_list_char()
{
	list<char> listTwo;  //用LISTCHAR创建一个list对象
	list<char>::iterator iter;  //声明i为迭代器
 
	listTwo.push_front('C');
	listTwo.push_front('B');
	listTwo.push_front('A');
 
	listTwo.push_back('D');
	listTwo.push_back('E');
	listTwo.push_back('F');
 
	iter = max_element(listTwo.begin(), listTwo.end());
	cout << "The maximum element in listTwo is: " << char(*iter) << endl;
	cout << endl;
	cout << endl;
}
